package com.eva.admin.job;

import com.eva.job.BaseJob;
import com.eva.job.JobContext;
import com.eva.job.JobParam;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 测试定时任务
 */
@Component("TestJob")
public class TestJob extends BaseJob {

    @Override
    public JobContext execute(JobParam param) {
        try {
            Thread.sleep(8888);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        JobContext context = new JobContext();
        context.setContext("测试任务执行完成，执行完成时间：" + new SimpleDateFormat("yyyy/MM/dd HH:mm:ss:sss").format(new Date()));
        return context;
    }
}
